package com.microservice.salmon.db.entities;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

@Table(name = "t_orders")
@Getter
@Setter
public class Order {
    /**
     * 订单自增ID
     */
    @Id
    @Column(name = "order_id")
    private Integer orderId;

    /**
     * 订单编号
     */
    @Column(name = "order_no")
    private Long orderNo;

    /**
     * 门店ID
     */
    @Column(name = "shop_id")
    private Integer shopId;

    /**
     * 用户ID 0：为0则说明是闪电购，游客直接下单
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     *订单状态 -3:用户拒收 -2:用户取消 -1:未付款 0:已付款 1: 待发货 2: 已发货 3: 配送中 4: 交易成功
     */
    @Column(name = "order_status")
    private Byte orderStatus;

    /**
     * 商品总金额	商品总价格 未进行任何折扣的总价格
     */
    @Column(name = "goods_money")
    private BigDecimal goodsMoney;

    /**
     * 收货方式 0:送货上门 1:自提
     */
    @Column(name = "deliver_type")
    private Byte deliverType;

    /**
     * 运费 运费规则按照每家店的规则算
     */
    @Column(name = "deliver_money")
    private BigDecimal deliverMoney;

    /**
     * 订单总金额 包括运费
     */
    @Column(name = "total_money")
    private BigDecimal totalMoney;

    /**
     * 实际订单总金额 进行各种折扣之后的金额
     */
    @Column(name = "real_total_money")
    private BigDecimal realTotalMoney;

    /**
     * 0:货到付款 1:在线支付
     */
    @Column(name = "pay_type")
    private Byte payType;

    /**
     * 支付来源 1:支付宝，2：微信
     */
    @Column(name = "pay_from")
    private String payFrom;

    /**
     * 在线支付交易流水
     */
    @Column(name = "trade_no")
    private String tradeNo;

    /**
     * 支付时间
     */
    @Column(name = "pay_time")
    private Date payTime;

    /**
     * 收件人地址
     */
    @Column(name = "user_address_id")
    private Integer userAddressId;

    /**
     * 所得积分
     */
    @Column(name = "order_score")
    private Integer orderScore;

    /**
     * 是否需要发票 1:需要 0:不需要
     */
    @Column(name = "is_invoice")
    private Byte isInvoice;

    /**
     * 发票抬头
     */
    @Column(name = "invoice_client")
    private String invoiceClient;

    /**
     * 订单备注
     */
    @Column(name = "order_remarks")
    private String orderRemarks;

    /**
     * 订单来源 0:商城 1:微信 2:手机版 3:安卓App 4:苹果App
     */
    @Column(name = "order_src")
    private Byte orderSrc;

    /**
     * 需缴费用
     */
    @Column(name = "need_pay")
    private BigDecimal needPay;

    @Column(name = "pay_rand")
    private Integer payRand;

    /**
     * 订单类型
     */
    @Column(name = "order_type")
    private Integer orderType;

    /**
     * 是否退款 0:否 1：是
     */
    @Column(name = "is_refund")
    private Byte isRefund;

    /**
     * 是否点评 0:未点评 1:已点评
     */
    @Column(name = "is_appraise")
    private Byte isAppraise;

    /**
     * 取消原因ID
     */
    @Column(name = "cancel_reason")
    private Integer cancelReason;

    /**
     * 拒收原因ID
     */
    @Column(name = "reject_reason")
    private Integer rejectReason;

    /**
     * 拒收原因
     */
    @Column(name = "reject_other_reason")
    private String rejectOtherReason;

    /**
     * 是否订单已完结 0：未完结 1:已完结
     */
    @Column(name = "is_closed")
    private Byte isClosed;

    /**
     * 订单流水号
     */
    @Column(name = "order_unique")
    private String orderUnique;

    /**
     * 收货时间
     */
    @Column(name = "receive_time")
    private Date receiveTime;

    /**
     * 发货时间
     */
    @Column(name = "delivery_time")
    private Date deliveryTime;

    /**
     * 快递公司ID
     */
    @Column(name = "express_id")
    private Integer expressId;

    /**
     * 快递号
     */
    @Column(name = "express_no")
    private String expressNo;

    /**
     * 订单有效标志 -1：删除 1:有效
     */
    @Column(name = "data_flag")
    private Byte dataFlag;

    /**
     * 是否结算，大于0的话则是结算ID
     */
    @Column(name = "settlement_id")
    private Integer settlementId;

    /**
     * 订单应收佣金
     */
    @Column(name = "commission_fee")
    private BigDecimal commissionFee;

    /**
     * 积分抵现
     */
    @Column(name = "score_money")
    private BigDecimal scoreMoney;

    /**
     * 用户积分
     */
    @Column(name = "use_score")
    private Integer useScore;

    /**
     * 订单种类，团购、等等
     */
    @Column(name = "order_code")
    private String orderCode;

    /**
     * 提醒发货 0:未提醒 1:已提醒
     */
    @Column(name = "notice_deliver")
    private Byte noticeDeliver;

    /**
     * 锁定提现金额
     */
    @Column(name = "lock_cash_money")
    private BigDecimal lockCashMoney;

    /**
     * 是否批量支付
     */
    @Column(name = "is_batch")
    private Byte isBatch;

    /**
     * 总支付佣金
     */
    @Column(name = "total_pay_fee")
    private Integer totalPayFee;

    /**
     * 创建时间(下单时间)
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 订单搜索关键字
     */
    @Column(name = "goods_search_keys")
    private String goodsSearchKeys;

    /**
     * 订单额外信息 json存储
     */
    @Column(name = "extra_json")
    private String extraJson;

    /**
     * 发票信息
     */
    @Column(name = "invoice_json")
    private String invoiceJson;

}